package com.gui.collection.list;

import cn.hutool.core.util.RandomUtil;
import com.gui.utils.Sleeper;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

public class ArrayListFailFastDemo {

    public static void main(String[] args) {

        List<String> dataList = new ArrayList<>();
        new Thread(() -> {
            Sleeper.sleep(TimeUnit.SECONDS, 1);
            dataList.add(RandomUtil.randomString(6));
        }).start();

        Sleeper.sleep(TimeUnit.SECONDS, 5);
        dataList.remove(0);

    }
}
